package com.test.demo.controller;

import com.test.demo.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Gao
 * @date 2020/8/7
 */
@RestController
public class MessageController {

    @Autowired
    private MessageService messageService;

    /**
     * rocketMq同步消息发送测试
     */
    @GetMapping("/rocketmq/sync-message")
    public void syncMessageSend() {
        messageService.syncMessageSend();
    }

    /**
     * rocketMq异步消息发送测试
     */
    @GetMapping("/rocketmq/async-message")
    public void asyncMessageSend() {
        messageService.asyncMessageSend();
    }

    /**
     * rocketMq单向发送不关心结果的发送测试【日志收集】
     */
    @GetMapping("/oneway-message")
    public void oneWayMessageSend() {
        messageService.oneWayMessageSend();
    }

    /**
     * 延迟消息发送测试
     */
    @GetMapping("/delayed-message")
    public void delayedMessageSend() {
        messageService.delayedMessageSend();
    }

    /**
     * 顺序消息发送
     */
    @GetMapping("/orderly-message")
    public void orderlyMessageSend() {
        messageService.orderlyMessageSend();
    }

    /**
     * 分布式事务消息发送
     */
    @GetMapping("/transaction-message")
    public void transactionSend() {
        messageService.transactionSend();
    }

    /**
     * 消息过滤消息发送
     */
    @GetMapping("/selector-message")
    public void selectorMQSend() {
        messageService.selectorMQSend();
    }
}
